package com.fone.player.service;

import com.fone.player.util.FoneUtil;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

public class NotificationInfo implements Parcelable {

	
	private long index = -1;
	private String name = null;
	private String dfnt = null;
	private String weibourl = "";
	private String ourl = "";
	private String url = null;
	private int btnply = 1;
	private String pic = "";
	private String desc = null;
	private String type = null;
	private Bitmap iconBitmap = null; //通知的显示图片
	private String notificationType = null; // 通知类型 1系统通知 2精彩影讯 3热剧追播 4更多精彩 5
											// 评论回复
	private int linkType = -1;
	private String time = null;
	private int status = 0; // 0: 未点击 1：点击
	private boolean isUpdate = false;
	public boolean toply;
	public boolean showPlayButton;
	public boolean showDownButton;
//	public int is_clicked; //
	public int showtype = 1; // 外部通知展现形式（用户未设置时使用）1系统通知栏展现 2通知弹框展现
	public long inserttime;//获取到通知的时间
	public long getInserttime() {
		return inserttime;
	}

	public void setInserttime(long inserttime) {
	
		this.inserttime = inserttime;
	}

	public boolean isToply() {
		return toply;
	}

	public void setToply(boolean toply) {
		this.toply = toply;
	}

	public boolean isShowPlayButton() {
		return showPlayButton;
	}

	public void setShowPlayButton(boolean showPlayButton) {
		this.showPlayButton = showPlayButton;
	}

	public boolean isShowDownButton() {
		return showDownButton;
	}

	public void setShowDownButton(boolean showDownButton) {
		this.showDownButton = showDownButton;
	}

	public boolean isUpdate() {
		return isUpdate;
	}

	public void setUpdate(boolean isUpdate) {
		this.isUpdate = isUpdate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public int getLinkType() {
		return linkType;
	}

	public void setLinkType(int linkType) {
		this.linkType = linkType;
	}

	/**
	 * 
	 * @return 1系统通知 2精彩影讯 3热剧追播 4更多精彩 5 评论回复
	 */
	public String getNotificationType() {
		return notificationType;
	}

	public void setNotificationType(String notificationType) {
		this.notificationType = notificationType;
	}

	public Bitmap getIconBitmap() {
		return iconBitmap;
	}

	public void setIconBitmap(Bitmap iconBitmap) {
		this.iconBitmap = iconBitmap;
	}

	public long getIndex() {
		return index;
	}

	public void setIndex(long index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDfnt() {
		return dfnt;
	}

	public void setDfnt(String dfnt) {
		this.dfnt = dfnt;
	}

	public String getWeibourl() {
		return weibourl;
	}

	public void setWeibourl(String weibourl) {
		this.weibourl = weibourl;
	}

	public String getOurl() {
		return ourl;
	}

	public void setOurl(String ourl) {
		this.ourl = ourl;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getBtnply() {
		return btnply;
	}

	public void setBtnply(int btnply) {
		this.btnply = btnply;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeLong(index);
		dest.writeString(name);
		dest.writeString(dfnt);
		dest.writeString(weibourl);
		dest.writeString(ourl);
		dest.writeString(url);
		dest.writeInt(btnply);
		dest.writeString(pic);
		dest.writeString(desc);
		dest.writeString(type);
		dest.writeParcelable(iconBitmap, flags);
		dest.writeString(notificationType); // 通知类型 1系统通知 2精彩影讯 3热剧追播 4更多精彩 5
											// 评论回复
		dest.writeString(linkType+"");
		dest.writeString(time);
		dest.writeInt(status); // 0: 未点击 1：点击
		dest.writeByte((byte) (isUpdate ? 1 : 0));
		dest.writeByte((byte) (toply ? 1 : 0));
		dest.writeByte((byte) (showPlayButton ? 1 : 0));
		dest.writeByte((byte) (showDownButton ? 1 : 0));
//		dest.writeInt(is_clicked); //
		dest.writeInt(showtype);
	}

	public static final Parcelable.Creator<NotificationInfo> CREATOR = new Parcelable.Creator<NotificationInfo>() {
		@Override
		public NotificationInfo createFromParcel(Parcel in) {
			return new NotificationInfo(in);
		}

		@Override
		public NotificationInfo[] newArray(int size) {
			return new NotificationInfo[size];
		}
	};

	private NotificationInfo(Parcel in) {
		index = in.readLong();
		name = in.readString();
		dfnt = in.readString();
		weibourl = in.readString();
		ourl = in.readString();
		url = in.readString();
		btnply = in.readInt();
		pic = in.readString();
		desc = in.readString();
		type = in.readString();
		iconBitmap = in.readParcelable(android.graphics.Bitmap.class
				.getClassLoader());
		notificationType = in.readString(); // 通知类型 1系统通知 2精彩影讯 3热剧追播 4更多精彩 5
											// 评论回复
		linkType = FoneUtil.String2Integer(in.readString());
		time = in.readString();
		status = in.readInt(); // 0: 未点击 1：点击
		isUpdate = in.readInt() == 1;
		toply = in.readInt() == 1;
		showPlayButton = in.readInt() == 1;
		showDownButton = in.readInt() == 1;
//		is_clicked = in.readInt();
		showtype = in.readInt();
	}

	public NotificationInfo() {
		// TODO Auto-generated constructor stub
	}

}
